
$(function(){	
	 var ww;
     var flash_w;
	 var indexs = 0;
	 var adTimers;
     var lens = $(".flash dt li").length; 
	 win();
	 window.onresize=win;
	 function win(){
	  ww=document.body.clientWidth;
      flash_w=(ww>1000)?ww:1000;
	 $(".flash dt li").width(flash_w);
	 $(".flash").width(flash_w);
	 $(".flash dt").width(flash_w);
     //alert(flash_w);
		 }

	 $('.flash').hover(function(){
			 clearInterval(adTimers);
		 },function(){
			 adTimers = setInterval(function(){
				indexs++;
				if(indexs==lens){indexs=0;}
			    showImgs(indexs,flash_w);
			  } , 4500);
	 }).trigger("mouseleave");
	 
	 
	 
	 $(".flash dd li").click(function(){
	    $(".flash dd li").removeClass("here");
	    $(this).addClass("here");
		indexs  = $(".flash dd li").index(this);
		showImgs(indexs,flash_w);
	 }).eq(0).mouseover();	 
	 
	      	    
	 var index3=0;
	 var adTimerss;
     var lens3 = Math.ceil( $(".lineimg dd ul li").length/3);
	 
     
	 $(".lineimg_pv").click(function(){
		index3=(index3==0)?0:index3-1;
		channels(index3,".lineimg dd ul",945);
	 });	
	 $(".lineimg_next").click(function(){
		index3=(index3+1==lens3)?0:index3+1;
		channels(index3,".lineimg dd ul",945);
	 });	
	 
	 

	 $('.lineimg').hover(function(){
			 clearInterval(adTimerss);
		 },function(){
			 adTimerss = setInterval(function(){
				index3++;
				if(index3==lens3){index3=0;}
			    channels(index3,".lineimg dd ul",945);
			  } , 5000);
	 }).trigger("mouseleave");
	 
	 
	 	
});
	
function showImgs(indexss,ws){
		lefts=-indexss*ws+"px";
		$(".flash dt ul").animate({left:lefts});
		    
}	

function channels(indexss,ids,channel_s){
		lefts=-indexss*channel_s+"px";
		$(ids).animate({left:lefts});
		    
}	